import base64
import binascii

from crypto.PublicKey import RSA
from crypto.Cipher import PKCS1_v1_5 as Cipher_pkcs1_v1_5


def rsaEncrypt(message):
    key = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCYLCumWz6MGHmAMLIaPt3SItIhMYHuyLn48muQz2xKj9PVqETGfjq/GTxHE3wfvGCEs/JXY1rV4uysUuAS/xwZuyJ9j+sB599lzmpxdhIWu/jGMR0h86nnpNUcssYwR3Bww3oU5+dYEtGpfOytMyh3eJeUZiNNBXqH+IaSYfU3hwIDAQAB'
    key1 = base64.b64decode(key)
    rsaKey = RSA.importKey(key1)
    cipher = Cipher_pkcs1_v1_5.new(rsaKey)
    temp = cipher.encrypt(message)
    return binascii.b2a_hex(temp)


if __name__ == '__main__':
    rsaEncrypt(13950346593)
